﻿Public Class QuickSearch : Inherits Process

	Public Overrides Sub GenericEvent(ByVal e As ProcessEventArgs)
		Select Case e.EventType
			Case EventType.Initialize
				Start("Hızlı arama", "Arama kriterini girin.")
				AddText("kimlik", "Kimlik, adı soyadı", "nl;width=25")
				AddText("sno", "Sigorta no.", "nl;width=8")
				'AddText("adsoyad", "Adı soyadı", "nl;width=25;uppercase")
				AddField("isyerino", "nl")
				AddText("isyeriadi", "İşyeri adı", "nl;width=25")
			Case EventType.Shown
				If Arguments("type") = 2 Then
					Focus("isyerino")
				End If
			Case EventType.ValidateInput
				If Not IsDirty(e.Name) Then Return
				Select Case e.Name
					Case "sno", "kimlik", "adsoyad"
						Dim Process As New SigortaliBilgileri
						Process.AddArgument("control", MainPanel.Controls(e.Name))
						FrmMain.AddWindow.Launch(Process)
						Close()
					Case "isyerino", "isyeriadi"
						Dim Process As New IsyeriBilgileri
						Process.AddArgument("control", MainPanel.Controls(e.Name))
						FrmMain.AddWindow.Launch(Process)
						Close()
				End Select
		End Select
	End Sub


End Class
